const REMOTE_API_HOST = 'http://localhost:9080';

console.log('REMOTE_API_ENV = dev, HOST = ' + REMOTE_API_HOST);

// 跨域设置
const PROXY_CONFIG = {
  '/api/*': {
    changeOrigin: true,
    target: REMOTE_API_HOST,
    pathRewrite: {
      '^/api': REMOTE_API_HOST + '/api',
    },
  },
  '/openapi/v1/*': {
    changeOrigin: true,
    target: REMOTE_API_HOST,
    pathRewrite: {
      '^/openapi/v1': REMOTE_API_HOST + '/openapi/v1',
    },
  },
  '/openapi/v2/*': {
    changeOrigin: true,
    target: REMOTE_API_HOST,
    pathRewrite: {
      '^/openapi/v2': REMOTE_API_HOST + '/openapi/v2',
    },
  }
};

export default {
  define: {
    'process.env.apiUrl': REMOTE_API_HOST,
  },
  proxy: PROXY_CONFIG,
};
